--- ./src/lib/common.py.orig	2012-06-12 00:29:21.000000000 +0000
+++ ./src/lib/common.py	2013-06-02 15:59:26.000000000 +0000
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 
+import sys
 import os
 import i18n
 from xdg.BaseDirectory import xdg_data_home
@@ -8,7 +9,7 @@
     from defs import *
 except:
     APPVERSION = "0.7.3"
-    datadir = "/usr/share"
+    datadir = "%%PREFIX%%/share"
 
 # Application info
 APPNAME = "Radio Tray"
@@ -47,10 +48,7 @@
 """ % COPYRIGHT_YEAR
 
 # Media path
-if os.path.exists(os.path.abspath('../data/images/')):
-    IMAGE_PATH = os.path.abspath('../data/images/')
-else:
-    IMAGE_PATH = '%s/%s/images' % (datadir, APPDIRNAME)
+IMAGE_PATH = '%s/%s/images' % (datadir, APPDIRNAME)
 
 # Images
 APP_ICON = os.path.join(IMAGE_PATH, 'radiotray.png')
@@ -66,11 +64,7 @@
 USER_CFG_PATH =  os.path.join(xdg_data_home, APPDIRNAME)
 OLD_USER_CFG_PATH = os.environ['HOME'] + "/.radiotray/"
 
-REL_CFG_DIR = os.path.abspath('../data/')
-if os.path.exists(os.path.join(REL_CFG_DIR, CFG_NAME)):
-    DEFAULT_CFG_PATH = REL_CFG_DIR
-else:
-    DEFAULT_CFG_PATH = '%s/%s/' % (datadir, APPDIRNAME)
+DEFAULT_CFG_PATH = '%s/%s/' % (datadir, APPDIRNAME)
 
 DEFAULT_RADIO_LIST = os.path.join(DEFAULT_CFG_PATH, CFG_NAME)
 DEFAULT_CONFIG_FILE = os.path.join(DEFAULT_CFG_PATH, OPTIONS_CFG_NAME)
@@ -88,7 +82,12 @@
 # user-agent
 try:
 	import platform
-	USER_AGENT = "%s/%s (%s %s; %s/%s (%s))" % ("RadioTray", APPVERSION, platform.system(), platform.machine(),
+	USER_AGENT = "%s/%s" % ("RadioTray", APPVERSION)
+
+	if sys.platform.startswith("freebsd"):
+		USER_AGENT += " (%s %s)" % (platform.system(), platform.release())
+	else:
+		USER_AGENT += " (%s %s; %s/%s (%s))" % (platform.system(), platform.machine(),
 												platform.linux_distribution()[0], platform.linux_distribution()[1],
 												platform.linux_distribution()[2])
 except:
